package sctu.edu.java.year2016.team05.wangliwei.day20160606.chapter15_1;

/**
 * 尝试定义一个继承Thread类的类，并覆盖run方法，在run方法中每隔100毫秒打印一句话
 */
public class Print {
    public static void main(String[] args) {

        XianCheng xc = new XianCheng();
        xc.start();

    }
}
 class XianCheng extends Thread {
    @Override
    public void run() {for(int i =1;i<=10;i++){

                System.out.println("线程的第"+i+"次循环");

                  try {
                            Thread.sleep(100);

                       } catch (InterruptedException e) {

                            e.printStackTrace();
                      }
              }

    }
}